// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceManager;
import com.nnee.p_a.p_a.cls_e;
import com.nnee.p_fk.cls_PreferenceActivityEx;
import com.nnee.p_fk.cls_d;
import com.nnee.p_fk.cls_j;
import com.nnee.p_fk.cls_k;
import com.nnee.p_pr.p_a.cls_b;
import com.nnee.p_pr.p_a.cls_f;
import com.nnee.p_pr.p_a.cls_h;
import com.nnee.p_pr.p_a.cls_q;
import com.nnee.p_pr.p_app.cls_PrisApp;
import com.nnee.p_pr.p_c.cls_l;
import com.nnee.p_pr.p_d.cls_c;
import com.nnee.p_up.cls_CheckVersionService;
import java.io.File;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            e, cn, cm, ek, 
//            MainGridActivity, LoginActivity, PRISActivityReport, PRISActivityGuide, 
//            PRISActivityWBSetting, en, l, d, 
//            b, PRISAboutActivity, OfflineDownloadMgrActivity

public class cls_PRISActivitySetting extends cls_PreferenceActivityEx
    implements android.preference.Preference.OnPreferenceChangeListener, android.preference.Preference.OnPreferenceClickListener
{

    public cls_PRISActivitySetting()
    {
        P = null;
        Q = null;
        R = null;
        S = null;
        T = 1;
        V = false;
        W = new Object();
    }

    public static int a(cls_cn cn1)
    {
        int i1 = 1;
        switch(com.nnee.p_pr.p_activity.cls_e.a[cn1.ordinal()])
        {
        case 1:
        	i1 = 0;
        	break;
        case 3:
        	i1 = 2;
        	break;
        case 4:
        	i1 = 3;
        	break;
        case 2:
        	default:
        	break;
        }
        return i1;
        
    }

    static ProgressDialog a(cls_PRISActivitySetting prisactivitysetting, ProgressDialog progressdialog)
    {
        prisactivitysetting.U = progressdialog;
        return progressdialog;
    }

    public static Intent a(Context context)
    {
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_PRISActivitySetting.class);
        intent.putExtra("mode", 2);
        return intent;
    }

    static Preference a(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.F;
    }

    public static cls_cn a(int i1)
    {
    	cls_cn cn1 = com.nnee.p_pr.p_activity.cls_cn.cTEXT_SIZE_LEVEL_2;
        switch(i1)
        {
        case 0:
        	cn1 = cls_cn.aTEXT_SIZE_LEVEL_0;
        	break;
        case 1:
        	cn1 = com.nnee.p_pr.p_activity.cls_cn.bTEXT_SIZE_LEVEL_1;
        	break;
        case 2:
        	cn1 = com.nnee.p_pr.p_activity.cls_cn.cTEXT_SIZE_LEVEL_2;
        	break;
        case 3:
        	cn1 = com.nnee.p_pr.p_activity.cls_cn.dTEXT_SIZE_LEVEL_3;
        	break;
        default:
        	break;
        }
        return cn1;
        
    }

    static cls_en a(cls_PRISActivitySetting prisactivitysetting, cls_en en1)
    {
    	prisactivitysetting.R = en1;
        return en1;
    }

    public static void a(Context context, long l1)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putLong("system_setting_ad_closetime", l1).commit();
    }

    public static void a(Context context, cls_cm cm1)
    {
        android.content.SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
        boolean flag;
        if(cm1 == com.nnee.p_pr.p_activity.cls_cm.bEAny)
            flag = true;
        else
            flag = false;
        editor.putBoolean("system_setting_allow_or_not_mobile_network_offline_download", flag);
    }

    public static void a(Context context, cls_cn cn1)
    {
        int i1 = -1 + a(cn1);
        PreferenceManager.getDefaultSharedPreferences(context).edit().putString("system_setting_textsize", Integer.toString(i1)).commit();
    }

    public static void a(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_predownload", flag).commit();
    }

    private void a(boolean flag)
    {
        String s1;
        if(flag)
        {
            s1 = "internal.skin.black";
            com.nnee.p_fk.cls_k.a(this).a(cls_PrisApp.a().B());
            cls_d d1 = new cls_d(getApplicationContext());
            com.nnee.p_fk.cls_k.a(this).a(d1);
        } else
        {
            s1 = getPackageName();
            com.nnee.p_fk.cls_k.a(this).a((String)null);
            com.nnee.p_fk.cls_k.a(this).a((String)null);
        }
        if(s1 != null)
            cls_PrisApp.a().a(s1);
        com.nnee.p_fk.cls_k.a(this).e();
        com.nnee.p_fk.cls_j.a().g();
    }

    static boolean a(cls_PRISActivitySetting prisactivitysetting, boolean flag)
    {
        prisactivitysetting.V = flag;
        return flag;
    }

    static Preference b(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.G;
    }

    static cls_en b(cls_PRISActivitySetting prisactivitysetting, cls_en en1)
    {
        prisactivitysetting.S = en1;
        return en1;
    }

    public static void b(Context context)
    {
    	cls_ek.a(context);
        cls_MainGridActivity.a(context, 0, true, 0);
    }

    public static void b(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_columnkey", flag).commit();
    }

    static ProgressDialog c(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.U;
    }

    public static void c(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_auto_refresh", flag).commit();
    }

    public static boolean c(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_predownload", false);
    }

    static Object d(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.W;
    }

    public static void d(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_fullscreen", flag).commit();
    }

    public static boolean d(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_columnkey", true);
    }

    public static void e(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_text_mode", flag).commit();
    }

    public static boolean e(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_auto_refresh", true);
    }

    static boolean e(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.V;
    }

    public static cls_cm f(Context context)
    {
    	cls_cm cm1;
        if(PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_allow_or_not_mobile_network_offline_download", false))
            cm1 = com.nnee.p_pr.p_activity.cls_cm.bEAny;
        else
            cm1 = cls_cm.aEWIFI;
        return cm1;
    }

    static cls_en f(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.R;
    }

    public static void f(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_night_mode", flag).commit();
    }

    public static cls_cn g(Context context)
    {
        return a(1 + Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(context).getString("system_setting_textsize", "1")));
    }

    static cls_en g(cls_PRISActivitySetting prisactivitysetting)
    {
        return prisactivitysetting.S;
    }

    public static void g(Activity activity)
    {
        Intent intent = new Intent(activity, com.nnee.p_pr.p_activity.cls_PRISActivitySetting.class);
        intent.putExtra("mode", 1);
        activity.startActivity(intent);
    }

    public static void g(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_firstarticle", flag).commit();
    }

    private boolean g()
    {
        if(com.nnee.p_b.p_a.cls_d.h().i())
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 653);
            cls_LoginActivity.a(this, 0, 5);
        } else
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 654);
            showDialog(4);
        }
        return true;
    }

    private void h()
    {
        if(com.nnee.p_b.p_a.cls_d.h().i())
        {
            D.setSummary(0x7f0a0113);
        } else
        {
            Preference preference = D;
            Object aobj[] = new Object[1];
            aobj[0] = com.nnee.p_b.p_a.cls_d.h().c();
            preference.setSummary(getString(0x7f0a0114, aobj));
        }
    }

    public static void h(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_source_list_first_show", flag).commit();
    }

    public static boolean h(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_fullscreen", false);
    }

    private Intent i()
    {
        return new Intent(this, com.nnee.p_pr.p_activity.cls_PRISActivityReport.class);
    }

    public static void i(Context context, boolean flag)
    {
        PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("system_setting_ad_close", flag).commit();
    }

    public static boolean i(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_text_mode", false);
    }

    private Intent j()
    {
        return new Intent(this, com.nnee.p_pr.p_activity.cls_PRISActivityGuide.class);
    }

    public static boolean j(Context context)
    {
        boolean flag;
        if(!com.nnee.p_fk.cls_k.a(context).c())
            flag = true;
        else
            flag = false;
        return flag;
    }

    private Intent k()
    {
        return new Intent(this, com.nnee.p_pr.p_activity.cls_PRISActivityWBSetting.class);
    }

    public static boolean k(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_firstarticle", true);
    }

    private void l()
    {
        if(R != null)
        {
            R.cancel(true);
            R = null;
        }
        if(P != null)
        {
            P.cancel(true);
            P = null;
        }
        P = new com.nnee.p_pr.p_activity.cls_l(this, this, T, 1);
        P.execute(new Void[0]);
    }

    public static boolean l(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_source_list_first_show", true);
    }

    private void m()
    {
        if(S != null)
        {
            S.cancel(true);
            S = null;
        }
        if(Q != null)
        {
            Q.cancel(true);
            Q = null;
        }
        Q = new com.nnee.p_pr.p_activity.cls_l(this, this, T, 2);
        Q.execute(new Void[0]);
    }

    public static boolean m(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("system_setting_ad_close", false);
    }

    public static long n(Context context)
    {
        return PreferenceManager.getDefaultSharedPreferences(context).getLong("system_setting_ad_closetime", 0L);
    }

    private void n()
    {
        Intent intent = com.nnee.p_pr.p_a.cls_b.a(this);
        if(com.nnee.p_pr.p_a.cls_b.a(this, intent))
            startActivity(intent);
        else
            com.nnee.p_pr.p_a.cls_b.a(this, "https://market.android.com/details?id=com.nnee.pris");
    }

    void a()
    {
        com.nnee.p_pr.p_a.cls_h.a(this, 0x7f0a010d);
    }

    void b()
    {
        String s1 = com.nnee.p_pr.p_a.cls_f.a(this, com.nnee.p_pr.p_a.cls_f.e(new File(com.nnee.p_a.p_a.cls_e.b())) + com.nnee.p_pr.p_a.cls_f.e(new File(com.nnee.p_a.p_a.cls_e.c())));
        Object aobj[] = new Object[1];
        aobj[0] = s1;
        String s2 = getString(0x7f0a010e, aobj);
        F.setSummary(s2);
    }

    void c()
    {
        long l1 = System.currentTimeMillis();
        com.nnee.p_b.p_a.cls_d.h().k();
        h();
        b(this);
        com.nnee.p_pr.p_d.cls_c.b(System.currentTimeMillis() - l1);
        com.nnee.p_pr.p_d.cls_c.a(com.nnee.p_pr.p_prot.cls_c.b);
    }

    void e()
    {
        setTitle(0x7f0a00fb);
        findPreference("system_setting_offline_download").setOnPreferenceClickListener(this);
        D = findPreference("system_setting_account");
        D.setOnPreferenceClickListener(this);
        h();
        C = (ListPreference)findPreference("system_setting_textsize");
        int i1 = a(g(this));
        ListPreference listpreference = C;
        Object aobj[] = new Object[1];
        aobj[0] = getResources().getStringArray(0x7f070008)[i1];
        listpreference.setSummary(getString(0x7f0a010f, aobj));
        C.setOnPreferenceChangeListener(this);
        E = findPreference("system_setting_weiboaccount");
        E.setOnPreferenceClickListener(this);
        Preference preference1;
        Object aobj2[];
        Preference preference2;
        Object aobj3[];
        Preference preference3;
        Object aobj4[];
        if(com.nnee.p_pr.p_c.cls_l.c(this) <= 0)
        {
            E.setSummary(0x7f0a0110);
        } else
        {
            Preference preference = E;
            Object aobj1[] = new Object[1];
            aobj1[0] = Integer.valueOf(com.nnee.p_pr.p_c.cls_l.c(this));
            preference.setSummary(getString(0x7f0a0111, aobj1));
        }
        E.setOnPreferenceClickListener(this);
        F = findPreference("system_setting_clear_cache");
        preference1 = F;
        aobj2 = new Object[1];
        aobj2[0] = getString(0x7f0a0116);
        preference1.setSummary(getString(0x7f0a010e, aobj2));
        F.setOnPreferenceClickListener(this);
        G = findPreference("system_setting_clear_offline_download_cache");
        preference2 = G;
        aobj3 = new Object[1];
        aobj3[0] = getString(0x7f0a0116);
        preference2.setSummary(getString(0x7f0a010e, aobj3));
        G.setOnPreferenceClickListener(this);
        H = findPreference("system_setting_update");
        H.setOnPreferenceClickListener(this);
        preference3 = H;
        aobj4 = new Object[1];
        aobj4[0] = com.nnee.p_pr.p_a.cls_q.a(this);
        preference3.setSummary(getString(0x7f0a0112, aobj4));
        I = findPreference("system_setting_report");
        I.setOnPreferenceClickListener(this);
        J = findPreference("system_setting_guide");
        J.setOnPreferenceClickListener(this);
        L = findPreference("system_setting_comment");
        L.setOnPreferenceClickListener(this);
        K = findPreference("system_setting_about");
        K.setOnPreferenceClickListener(this);
        findPreference("system_setting_columnkey").setOnPreferenceChangeListener(this);
        findPreference("system_setting_allow_or_not_mobile_network_offline_download").setOnPreferenceChangeListener(this);
        findPreference("system_setting_auto_refresh").setOnPreferenceChangeListener(this);
        findPreference("system_setting_night_mode2").setOnPreferenceChangeListener(this);
    }

    protected void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        addPreferencesFromResource(0x7f050003);
        N = this;
        e();
        if(getIntent() != null)
            T = getIntent().getIntExtra("mode", 1);
        String as[] = new String[2];
        as[0] = com.nnee.p_a.p_a.cls_e.b();
        as[1] = com.nnee.p_a.p_a.cls_e.c();
        R = new cls_en(this, this, 1, as);
        R.execute(new Void[0]);
        String as1[] = new String[2];
        as1[0] = com.nnee.p_a.p_a.cls_e.d();
        as1[1] = com.nnee.p_a.p_a.cls_e.e();
        S = new cls_en(this, this, 2, as1);
        S.execute(new Void[0]);
    }

    protected Dialog onCreateDialog(int i1)
    {Object obj =null;
        switch(i1)
        {
        case 4:
        	 android.app.AlertDialog.Builder builder = (new android.app.AlertDialog.Builder(this)).setIcon(0x7f020087).setTitle(0x7f0a0102);
             Object aobj[] = new Object[1];
             aobj[0] = com.nnee.p_b.p_a.cls_d.h().c();
             obj = builder.setMessage(getString(0x7f0a0103, aobj)).setPositiveButton(0x7f0a0104, new com.nnee.p_pr.p_activity.cls_d(this))
            		 .setNegativeButton(0x7f0a0105, new com.nnee.p_pr.p_activity.cls_b(this)).create();

        	break;
        	default:
        		  obj = super.onCreateDialog(i1);
        		break;
        }
        return ((Dialog) (obj));
       
    }

    protected void onDestroy()
    {
        super.onDestroy();
        if(P != null)
        {
            P.cancel(true);
            P = null;
        }
        if(R != null)
        {
            R.cancel(true);
            R = null;
        }
        if(S != null)
        {
            S.cancel(true);
            S = null;
        }
        if(Q != null)
        {
            Q.cancel(true);
            Q = null;
        }
    }

    protected void onNewIntent(Intent intent)
    {
        super.onNewIntent(intent);
        if(intent != null)
            T = intent.getIntExtra("mode", 1);
    }

    public boolean onPreferenceChange(Preference preference, Object obj)
    {
        boolean flag = true;
        String s1 = preference.getKey();
        if(s1.equals("system_setting_textsize"))
        {
            int i1 = 1 + Integer.parseInt((String)obj);
            C.setValueIndex(i1);
            String s2 = getResources().getStringArray(0x7f070008)[i1];
            ListPreference listpreference = C;
            Object aobj[] = new Object[1];
            aobj[0] = s2;
            listpreference.setSummary(getString(0x7f0a010f, aobj));
            com.nnee.p_pr.p_d.cls_c.a(f(), 642, s2);
        } else
        if(s1.equals("system_setting_columnkey"))
        {
            if(((Boolean)obj).booleanValue())
                com.nnee.p_pr.p_d.cls_c.a(f(), 640);
            else
                com.nnee.p_pr.p_d.cls_c.a(f(), 641);
        } else
        if(s1.equals("system_setting_allow_or_not_mobile_network_offline_download"))
        {
            if(((Boolean)obj).booleanValue())
                com.nnee.p_pr.p_d.cls_c.a(f(), 643);
            else
                com.nnee.p_pr.p_d.cls_c.a(f(), 644);
        } else
        if(s1.equals("system_setting_auto_refresh"))
        {
            if(((Boolean)obj).booleanValue())
                com.nnee.p_pr.p_d.cls_c.a(f(), 658);
            else
                com.nnee.p_pr.p_d.cls_c.a(f(), 659);
        } else
        if(s1.equals("system_setting_night_mode2"))
            a(((Boolean)obj).booleanValue());
        else
            flag = false;
        return flag;
    }

    public boolean onPreferenceClick(Preference preference)
    {
        boolean flag = true;
        String s1 = preference.getKey();
        if(s1.equals("system_setting_account"))
            flag = g();
        else
        if(s1.equals("system_setting_about"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 665);
            cls_PRISAboutActivity.a(this);
        } else
        if(s1.equals("system_setting_update"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 660);
            cls_CheckVersionService.a(this, flag);
        } else
        if(s1.equals("system_setting_clear_cache"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 656);
            l();
        } else
        if(s1.equals("system_setting_weiboaccount"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 655);
            startActivity(k());
        } else
        if(s1.equals("system_setting_comment"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 664);
            n();
        } else
        if(s1.equals("system_setting_clear_offline_download_cache"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 657);
            m();
        } else
        if(s1.equals("system_setting_offline_download"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 645);
            startActivity(com.nnee.p_pr.p_activity.cls_OfflineDownloadMgrActivity.b((Context)this));
        } else
        if(s1.equals("system_setting_guide"))
        {
            com.nnee.p_pr.p_d.cls_c.a(f(), 661);
            startActivity(j());
        } else
        {
            if(s1.equals("system_setting_report"))
            {
                com.nnee.p_pr.p_d.cls_c.a(f(), 662);
                startActivity(i());
            }
            flag = false;
        }
        return flag;
    }

    protected void onResume()
    {
        h();
        Preference preference = E;
        Object aobj[] = new Object[1];
        aobj[0] = Integer.valueOf(com.nnee.p_pr.p_c.cls_l.c(this));
        preference.setSummary(getString(0x7f0a010c, aobj));
        super.onResume();
    }

    private static final String A = "system_setting_ad_closetime";
    private static final String B = "system_setting_source_list_first_show";
    private static final int O = 4;
    private static final int X = 1;
    private static final int Y = 2;
    private static final int Z = 1;
    private static final String a = com.nnee.p_pr.p_activity.cls_PRISActivitySetting.class.getSimpleName();
    private static final int aa = 2;
    private static final String b = "https://market.android.com/details?id=com.nnee.pris";
    private static final String c = "mode";
    private static final int d = 1;
    private static final int e = 2;
    private static final String f = "system_setting_predownload";
    private static final String g = "system_setting_columnkey";
    private static final String h = "system_setting_night_mode2";
    private static final String i = "system_setting_textsize";
    private static final String j = "system_setting_allow_or_not_mobile_network_offline_download";
    private static final String k = "system_setting_text_mode";
    private static final String l = "system_setting_night_mode";
    private static final String m = "system_setting_offline_download";
    private static final String n = "system_setting_auto_refresh";
    private static final String o = "system_setting_fullscreen";
    private static final String p = "system_setting_firstarticle";
    private static final String q = "system_setting_account";
    private static final String r = "system_setting_weiboaccount";
    private static final String s = "system_setting_clear_cache";
    private static final String t = "system_setting_clear_offline_download_cache";
    private static final String u = "system_setting_update";
    private static final String v = "system_setting_guide";
    private static final String w = "system_setting_report";
    private static final String x = "system_setting_about";
    private static final String y = "system_setting_comment";
    private static final String z = "system_setting_ad_close";
    private ListPreference C;
    private Preference D;
    private Preference E;
    private Preference F;
    private Preference G;
    private Preference H;
    private Preference I;
    private Preference J;
    private Preference K;
    private Preference L;
    private Preference M;
    private Context N;
    private com.nnee.p_pr.p_activity.cls_l P;
    private com.nnee.p_pr.p_activity.cls_l Q;
    private cls_en R;
    private cls_en S;
    private int T;
    private ProgressDialog U;
    private boolean V;
    private Object W;

}
